Skip to content

feat(runtime-core): add import-map remote entry support#4390

Draft
ScriptedAlchemy wants to merge 40 commits intomainfrom
cursor/runtime-core-federation-importmaps-556d
Draft

feat(runtime-core): add import-map remote entry support#4390
ScriptedAlchemy wants to merge 40 commits intomainfrom
cursor/runtime-core-federation-importmaps-556d

Conversation

@ScriptedAlchemy
Copy link
Member

@ScriptedAlchemy ScriptedAlchemy commented Feb 8, 2026

Summary

  • add import-map based remote entry support in runtime-core
  • wire shared import handling to honor import configuration with dynamic import flows
  • expose disableImportMap optimization options through enhanced/rspack/sdk plugin surfaces
  • include docs and runnable import-map app examples for verification

Changed Packages

  • @module-federation/runtime-core
  • @module-federation/enhanced
  • @module-federation/rspack
  • @module-federation/sdk

Changesets

  • .changeset/clean-cobras-rest.md (patch for all listed packages)

Base

  • main

Single-PR Review Guide (No Additional PRs)

This PR will remain a single PR. Improvements are being done in-place (no stacked or follow-up PR splitting).

Suggested Review Order

  1. Core behavior/runtime changes first.
  2. Build/tooling and workflow updates second.
  3. Docs/examples/app fixtures last.

In-Place Scope Trim Checklist

  • Remove unrelated churn not required for this PR goal.
  • Keep lockfile and generated changes only when strictly needed.
  • Confirm acceptance criteria and regression tests are explicit in this PR.
  • Resolve merge conflict status and required CI checks before final re-review.

@cursor
Copy link

cursor bot commented Feb 8, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@netlify
Copy link

netlify bot commented Feb 8, 2026

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit 0a0c44c
🔍 Latest deploy log https://app.netlify.com/projects/module-federation-docs/deploys/69b05fa172fb4a00088a90bc
😎 Deploy Preview https://deploy-preview-4390--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot
Copy link

changeset-bot bot commented Feb 8, 2026

🦋 Changeset detected

Latest commit: 0a0c44c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 45 packages
Name Type
@module-federation/runtime-core Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/sdk Patch
@module-federation/runtime Patch
@module-federation/bridge-react Patch
@module-federation/modern-js-v3 Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/node Patch
@module-federation/rsbuild-plugin Patch
@module-federation/rspress-plugin Patch
@module-federation/storybook-addon Patch
shared-tree-shaking-no-server-host Patch
shared-tree-shaking-no-server-provider Patch
@module-federation/devtools Patch
@module-federation/cli Patch
@module-federation/data-prefetch Patch
@module-federation/dts-plugin Patch
@module-federation/esbuild Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/metro Patch
@module-federation/retry-plugin Patch
@module-federation/utilities Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/bridge-vue3 Patch
@module-federation/runtime-tools Patch
shared-tree-shaking-with-server-host Patch
shared-tree-shaking-with-server-provider Patch
node-dynamic-remote-new-version Patch
node-dynamic-remote Patch
remote5 Patch
remote6 Patch
website-new Patch
@module-federation/metro-plugin-rnc-cli Patch
@module-federation/metro-plugin-rnef Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/bridge-shared Patch
@module-federation/error-codes Patch
create-module-federation Patch
@module-federation/treeshake-server Patch
@module-federation/treeshake-frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2026

Bundle Size Report

10 package(s) changed, 31 unchanged.

Package Total dist Delta ESM gzip Delta
runtime-core 252.1 kB +2.8 kB (+1.1%) 477 B no change
vue3-bridge 142.2 kB +1.6 kB (+1.1%) 21.8 kB +280 B (+1.3%)
enhanced 840.4 kB +862 B (+0.1%) 712 B no change
rspack 59.3 kB +750 B (+1.2%) 211 B no change
bridge-react 358.2 kB +591 B (+0.2%) 1.3 kB -3 B (-0.2%)
webpack-bundler-runtime 88.7 kB +208 B (+0.2%) 405 B no change
dts-plugin 298.0 kB +170 B (+0.1%) 4.3 kB no change
retry-plugin 61.2 kB +170 B (+0.3%) 2.8 kB no change
sdk 108.1 kB +126 B (+0.1%) 755 B no change
rsbuild-plugin 120.0 kB +40 B (+0.0%) 91 B no change

Total dist: 6.39 MB (+7.2 kB (+0.1%))
Total ESM gzip: 79.5 kB (+277 B (+0.3%))

@ScriptedAlchemy ScriptedAlchemy changed the title Runtime-core federation importmaps feat(runtime-core): support import map remote entries Feb 9, 2026
@ScriptedAlchemy
Copy link
Member Author

@cursor need import maps support for shared modules as well.

@cursor
Copy link

cursor bot commented Feb 9, 2026

Thanks for the request — we can add import‑map support for shared modules too.

Today runtime‑core already lets you do it manually by providing a get that calls import('specifier'), so bare specifiers resolve via import maps. But I can make it first‑class so you don’t have to hand‑write get.

Proposed approach (small, explicit API):

  • Extend runtime‑core shared args with an optional import (or importSpec) field.
  • When import is provided, runtime‑core auto‑builds get: () => import(/* webpackIgnore */ import).
  • If import is a bare specifier, it will resolve via your import map.
  • Guard the logic behind FEDERATION_OPTIMIZE_NO_IMPORTMAP (same as remotes) so it can be tree‑shaken.

Example target API:

shared: {
  react: {
    import: 'react',
    version: '18.3.1',
    shareConfig: { singleton: true },
  },
}

Before I implement, can you confirm:

  1. Is import the shape you want, or should it be importSpec/importMap?
  2. Do you want this only in runtime‑core (manual runtime usage), or also via the build plugins’ shared config?

Once I have that, I’ll add the runtime support + tests and update docs.

Open in Cursor Open in Web

@ScriptedAlchemy ScriptedAlchemy changed the title feat(runtime-core): support import map remote entries feat(runtime-core): add import-map remote entry support Feb 12, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2026

Open in StackBlitz

@module-federation/devtools

pnpm add https://pkg.pr.new/@module-federation/devtools@86f0ea9

@module-federation/cli

pnpm add https://pkg.pr.new/@module-federation/cli@86f0ea9

create-module-federation

pnpm add https://pkg.pr.new/create-module-federation@86f0ea9

@module-federation/data-prefetch

pnpm add https://pkg.pr.new/@module-federation/data-prefetch@86f0ea9

@module-federation/dts-plugin

pnpm add https://pkg.pr.new/@module-federation/dts-plugin@86f0ea9

@module-federation/enhanced

pnpm add https://pkg.pr.new/@module-federation/enhanced@86f0ea9

@module-federation/error-codes

pnpm add https://pkg.pr.new/@module-federation/error-codes@86f0ea9

@module-federation/esbuild

pnpm add https://pkg.pr.new/@module-federation/esbuild@86f0ea9

@module-federation/managers

pnpm add https://pkg.pr.new/@module-federation/managers@86f0ea9

@module-federation/manifest

pnpm add https://pkg.pr.new/@module-federation/manifest@86f0ea9

@module-federation/metro

pnpm add https://pkg.pr.new/@module-federation/metro@86f0ea9

@module-federation/metro-plugin-rnc-cli

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnc-cli@86f0ea9

@module-federation/metro-plugin-rnef

pnpm add https://pkg.pr.new/@module-federation/metro-plugin-rnef@86f0ea9

@module-federation/modern-js

pnpm add https://pkg.pr.new/@module-federation/modern-js@86f0ea9

@module-federation/modern-js-v3

pnpm add https://pkg.pr.new/@module-federation/modern-js-v3@86f0ea9

@module-federation/native-federation-tests

pnpm add https://pkg.pr.new/@module-federation/native-federation-tests@86f0ea9

@module-federation/native-federation-typescript

pnpm add https://pkg.pr.new/@module-federation/native-federation-typescript@86f0ea9

@module-federation/nextjs-mf

pnpm add https://pkg.pr.new/@module-federation/nextjs-mf@86f0ea9

@module-federation/node

pnpm add https://pkg.pr.new/@module-federation/node@86f0ea9

@module-federation/retry-plugin

pnpm add https://pkg.pr.new/@module-federation/retry-plugin@86f0ea9

@module-federation/rsbuild-plugin

pnpm add https://pkg.pr.new/@module-federation/rsbuild-plugin@86f0ea9

@module-federation/rspack

pnpm add https://pkg.pr.new/@module-federation/rspack@86f0ea9

@module-federation/rspress-plugin

pnpm add https://pkg.pr.new/@module-federation/rspress-plugin@86f0ea9

@module-federation/runtime

pnpm add https://pkg.pr.new/@module-federation/runtime@86f0ea9

@module-federation/runtime-core

pnpm add https://pkg.pr.new/@module-federation/runtime-core@86f0ea9

@module-federation/runtime-tools

pnpm add https://pkg.pr.new/@module-federation/runtime-tools@86f0ea9

@module-federation/sdk

pnpm add https://pkg.pr.new/@module-federation/sdk@86f0ea9

@module-federation/storybook-addon

pnpm add https://pkg.pr.new/@module-federation/storybook-addon@86f0ea9

@module-federation/third-party-dts-extractor

pnpm add https://pkg.pr.new/@module-federation/third-party-dts-extractor@86f0ea9

@module-federation/treeshake-frontend

pnpm add https://pkg.pr.new/@module-federation/treeshake-frontend@86f0ea9

@module-federation/treeshake-server

pnpm add https://pkg.pr.new/@module-federation/treeshake-server@86f0ea9

@module-federation/typescript

pnpm add https://pkg.pr.new/@module-federation/typescript@86f0ea9

@module-federation/utilities

pnpm add https://pkg.pr.new/@module-federation/utilities@86f0ea9

@module-federation/webpack-bundler-runtime

pnpm add https://pkg.pr.new/@module-federation/webpack-bundler-runtime@86f0ea9

@module-federation/bridge-react

pnpm add https://pkg.pr.new/@module-federation/bridge-react@86f0ea9

@module-federation/bridge-react-webpack-plugin

pnpm add https://pkg.pr.new/@module-federation/bridge-react-webpack-plugin@86f0ea9

@module-federation/bridge-shared

pnpm add https://pkg.pr.new/@module-federation/bridge-shared@86f0ea9

@module-federation/bridge-vue3

pnpm add https://pkg.pr.new/@module-federation/bridge-vue3@86f0ea9

@module-federation/inject-external-runtime-core-plugin

pnpm add https://pkg.pr.new/@module-federation/inject-external-runtime-core-plugin@86f0ea9

commit: 86f0ea9

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

Android Release APK for all devices

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2026-02-15T22:33:27.407Z UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

iOS Release APP for simulators

🔗 Download link.

Note: if the download link expires, please re-run the workflow to generate a new build.

Generated at 2026-02-15T22:35:04.466Z UTC

ScriptedAlchemy and others added 22 commits February 15, 2026 13:41
Resolve the dts-plugin TYPE-001 failure by correcting package entry paths for
workspace dependencies and updating RawSource usage for webpack typings.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove leftover dead config mutation block and close the exported config
function so nx format:check can parse the file in CI.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore sdk and error-codes export paths to the filenames emitted by the
current build so CI package resolution no longer fails on these branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants